home *** CD-ROM | disk | FTP | other *** search
- Path: grease.sms.co.uk!usenet
- From: Piers Scannell <piers@sms.co.uk>
- Newsgroups: comp.lang.c++
- Subject: Re: Problem: ERROR: Cannot convert 'const void * ' to ' const HBITMAP_* '
- Date: 7 Mar 1996 00:20:51 GMT
- Organization: Satellite Media Services
- Message-ID: <4hla53$qhg@grease.sms.co.uk>
- References: <4h9a8h$89i@neptunus.pi.net>
- NNTP-Posting-Host: caroline.sms.co.uk
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 1.22 (Windows; I; 16bit)
-
- cat.tech@pi.net (Remy Cool) wrote:
-
- >/* code as described in online help BitBlt function */
- >
- [sniped line]
- > hbmpOld = SelectObject(hdcMemory, hbmpGraphic); // >>> Line 98
-
- >When I use this code in my program, I get the following Compiler Error.
- >
- >Error MyApp.CPP 98: Cannot convert 'const void *' to 'const HBITMAP__ *'
- >
-
- short answer: cast to HBITMAP:
- hbmpOld = (HBITMAP) SelectObject(...
-
- the cause is the way handles are defined in windows.h depending on
- whether STRICT is defined; check out windows.h (search for HBITMAP
- and work back - it's all clever stuff pretending what's just a word
- value is really a near pointer and stuff, which is probably there
- to cause precisely these kind of errors...
-
-
-